<%@ page import="org.acegisecurity.context.SecurityContextHolder" %>
<%@ page import="org.acegisecurity.Authentication" %>
<%@ page import="org.acegisecurity.ui.AccessDeniedHandlerImpl" %>

<% String privilegeModified = request.getParameter("privilegeModified"); %>

<%if(privilegeModified != null && privilegeModified.equalsIgnoreCase("true")){ %>

	<body onload="logoutUser();"  />
		
	
	<script>
	
	 function logoutUser(){
	 
	  	alert("Privilege has been modified..Please relogin the application");
		window.parent.location.href="<%= request.getContextPath() %>/logout.do?method=logOut";
		$.cookie("DOCUMENT_LOADED","true");
	 }
	
	</script>
	
	
<% } else{ %>
	
	
	<h1>Sorry, access is denied</h1>


<p>
<%= request.getAttribute(AccessDeniedHandlerImpl.ACEGI_SECURITY_ACCESS_DENIED_EXCEPTION_KEY)%>

<p>

<%		Authentication auth = SecurityContextHolder.getContext().getAuthentication();
		if (auth != null) { %>
			Logged in account : <%= auth.toString() %><BR><BR>
<%      } %>
	
	
	
<%}%>




